import request from '@/config/axios'

// PI 巡检清单类别 VO
export interface BomCategoryVO {
  id: number // 编号
  name: string // 名字
  parentId: number // 父级编号
  sort: number // 排序
}

// PI 巡检清单类别 API
export const BomCategoryApi = {
  // 查询PI 巡检清单类别列表
  getBomCategoryList: async (params) => {
    return await request.get({ url: `/pi/bom-category/list`, params })
  },

  // 查询PI 巡检清单类别详情
  getBomCategory: async (id: number) => {
    return await request.get({ url: `/pi/bom-category/get?id=` + id })
  },

  // 新增PI 巡检清单类别
  createBomCategory: async (data: BomCategoryVO) => {
    return await request.post({ url: `/pi/bom-category/create`, data })
  },

  // 修改PI 巡检清单类别
  updateBomCategory: async (data: BomCategoryVO) => {
    return await request.put({ url: `/pi/bom-category/update`, data })
  },

  // 删除PI 巡检清单类别
  deleteBomCategory: async (id: number) => {
    return await request.delete({ url: `/pi/bom-category/delete?id=` + id })
  },

  // 导出PI 巡检清单类别 Excel
  exportBomCategory: async (params) => {
    return await request.download({ url: `/pi/bom-category/export-excel`, params })
  },
}